//
//  WFSetCell.m
//  谷居
//
//  Created by dllo on 16/6/30.
//  Copyright © 2016年 刘万方. All rights reserved.
//

#import "WFSetCell.h"
#import "Masonry.h"
@implementation WFSetCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    _leftImageView = [[WFImageView alloc] init];
    [self.contentView addSubview:_leftImageView];
    [_leftImageView release];
    
    
    
    
    _rightLabel = [[WFLabel alloc] init];
    [self.contentView addSubview:_rightLabel];
    [_rightLabel release];
    
    
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [_leftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.top.equalTo(self.contentView).offset(15);
        make.bottom.equalTo(self.contentView).offset(-15);
        make.width.equalTo(_leftImageView.mas_height);
    }];
    
    [_rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(_leftImageView.mas_right).offset(15);
        make.centerY.equalTo(self.contentView);
        make.height.equalTo(_leftImageView.mas_height);
        
        make.width.greaterThanOrEqualTo(@60);
    }];
    
    
    [_rightLabel sizeToFit];
}
@end
